/*
 * Copyright
 */
package java.util.concurrent.locks;

/**
 * 定义安全类（锁）的顶层类，记录了操作线程 exclusiveOwnerThread
 *
 * @author ztkool
 * @since 1.0.0
 */
public abstract class AbstractOwnableSynchronizer implements java.io.Serializable {

    private static final long serialVersionUID = 3737899427754241961L;

    protected AbstractOwnableSynchronizer() {
    }

    /**
     * 占有锁的线程
     */
    private transient Thread exclusiveOwnerThread;

    protected final void setExclusiveOwnerThread(Thread thread) {
        exclusiveOwnerThread = thread;
    }

    protected final Thread getExclusiveOwnerThread() {
        return exclusiveOwnerThread;
    }
}
